{template header}
<div class="container">
<div class="row">




    <div>
        <div class="panel panel-default">
            <div class="panel-body">

                {template menu}


<div class="usermsg">
<ul>
{loop $arrMessage $key $item}
<li {if $item[userid] == $TS_USER[userid]}class="mysend"{/if}>
{if $item[userid]==$TS_USER[userid]}<span style="color:#006efe;">{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}</span>{else}<span style="color:#42b475;">{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}</span>{/if}
<br />
{$item[content]}
</li>
    <li style="text-align:right "><a class="btn btn-w"  href="javascript:void(0)" onclick="delmessage('{$item[messageid]}')">删除</a> </li>
{/loop}
</ul>
</div>

<div class="sendbox">
<p>和<span style="color:#0066cc;">{$strTouser[username]}</span>进行及时消息通话中</p>
<p><textarea class="form-control" id="boxcontent" style="width: 100%"></textarea> </p>
<p>
<span id="sendbutton" style="display:block;"><a class="btn btn-success" href="javascript:void('0');" onclick="window.parent.sendmsg('{$TS_USER[userid]}','{$strTouser[userid]}');">发送</a></span>
<span id="loading" style="display:none;">消息送达中<img src="{SITE_URL}app/{$app}/skins/{$skin}/loading.gif" alt="Loading..." /></span>
</p>
</div>


</div>
</div>
</div>



</div>
</div>

{template footer}

<script>
    //删除消息
    function delmessage(messageid){


        if (confirm('删除这条消息吗？')) {

            $.ajax({
                type: "POST",
                url: siteUrl+"index.php?app=message&ac=delmsg",
                data: "messageid="+messageid,
                beforeSend:function(){
                },
                success:function(result){
                    if(result == '1'){
                        window.location.reload();
                    }
                }
            });

        }
    }

</script>